package br.com.velp.sudecap.serviceimpl;

import br.com.velp.sudecap.comum.SpringConstants;
import br.com.velp.sudecap.dao.AutorDAO;
import br.com.velp.sudecap.entidade.Autor;
import br.com.velp.sudecap.service.AutorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 * @author Eduardo
 */
@Service("autorService")
@Transactional(readOnly = true)
@Lazy(SpringConstants.LAZY_BEANS)
public class AutorServiceImpl implements AutorService {
    
    @Autowired
    private AutorDAO autorDAO;

    @Override
    @Transactional(readOnly = false)
    public Long salvar(Autor value) throws Exception {
        return this.autorDAO.salvar(value);
    }

    @Override
    @Transactional(readOnly = false)
    public void atualizar(Autor value) throws Exception {
        this.autorDAO.atualizar(value);
    }

    @Override
    public Autor obterPorId(Long id) {
        return this.autorDAO.obterPorId(id);
    }

    @Override
    @Transactional(readOnly = false)
    public void excluir(Autor value) throws Exception {
        this.autorDAO.excluir(value);
    }
    
}
